package com.gtw.modules.api.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.gtw.modules.api.service.TbShoppingCartServices;
import com.gtw.modules.dao.TbShoppingCartDao;
import com.gtw.modules.entity.TbCommodity;
import com.gtw.modules.entity.TbShoppingCart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service("tbshoppingcartservices")
public class TbShoppingCartServicesImpl implements TbShoppingCartServices {

    @Autowired
    private TbShoppingCartDao tbShoppingCartDao;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return tbShoppingCartDao.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TbShoppingCart record) {
        return tbShoppingCartDao.insert(record);
    }

    @Override
    public int insertSelective(TbShoppingCart record) {
        return tbShoppingCartDao.insertSelective(record);
    }

    @Override
    public TbShoppingCart selectByPrimaryKey(Integer id) {
        return tbShoppingCartDao.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TbShoppingCart record) {
        return tbShoppingCartDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TbShoppingCart record) {
        return tbShoppingCartDao.updateByPrimaryKey(record);
    }

    @Override
    public TbShoppingCart findByCommodity(Integer commodityId, String uid, String selected) {
        return tbShoppingCartDao.findByCommodity(commodityId, uid, selected);
    }

    @Override
    public Page<TbShoppingCart> queryPageList(Page<TbShoppingCart> page, Map<String, Object> map) {
        page.setRecords(tbShoppingCartDao.queryPageList(page, map));
        return page;
    }
}
